from typing import Final, List, final

# 定义不可重新赋值的变量
MAX_USERS: Final = 100
API_KEY: Final[str] = "abc123"

# 不可重新赋值的属性
class Config:
    DEBUG: Final = False
    MAX_CONNECTIONS: Final[int] = 10
    
    def __init__(self) -> None:
        self.version: Final = "1.0"  # 实例的Final属性

# 标记不应被继承的类
@final
class SecurityManager:
    pass

# 标记不应被重写的方法
class BaseService:
    @final
    def authenticate(self) -> bool:
        return True